import { http } from '@/utils/http/axios';

/**
 * @description: 分页查询
 */
export function fetchList(query) {
  return http.request({
    url: '/admin/client/page',
    method: 'get',
    params: query,
  });
}

/**
 * 添加设备端
 * @param params
 */
export function addObj(obj) {
  return http.request({
    url: '/admin/client',
    method: 'post',
    data: obj,
  });
}

export function getObj(id) {
  return http.request({
    url: '/admin/client/' + id,
    method: 'get',
  });
}

export function delObj(id) {
  return http.request({
    url: '/admin/client/' + id,
    method: 'delete',
  });
}

export function putObj(obj) {
  return http.request({
    url: '/admin/client',
    method: 'put',
    data: obj,
  });
}

export function clearClientCache() {
  return http.request({
    url: '/admin/client/cache',
    method: 'delete',
  });
}
